<?php
class Hydrum_Pathfinder extends Hydrum_Pathfinder_Paths
{
    /**
     * Get pathfinder by relative path
     *
     * @param string $relative
     * @return Hydrum_Pathfinder
     */
    public function find($relative)
    {
        $paths = array();

        foreach ($this->getPaths() as $path) {

            $paths[] = $path . DS . $relative;
        }

        return new self($paths);
    }

    /**
     * Get paths
     * 
     * @return Hydrum_Pathfinder_Paths
     */
    public function lookup($regexp = null)
    {
        $paths = new Hydrum_Pathfinder_Paths();

        foreach ($this->getPaths(true) as $path) {

            $paths->merge($path->lookup($regexp));
        }

        return $paths;
    }
}
